define(['jquery'],function($){
    var ajaxService  = function(){

        var baseUrl = 'http://localhost:9300',

            get = function(method,resultCallBack,faultCallBack){
                $.ajax({
                url : baseUrl + '/'+ method,
                type: "GET",
                timeout: 15000,
                success:  function (data) {
                     resultCallBack(data);
                },
                 error: function (requestObj, status, error) {
                        faultCallBack(error);
                 },
                 complete: function (requestObj, status) {

                 }

                });
            },
            post = function(method,data,resultCallBack,faultCallBack){

                $.ajax({
                    url : baseUrl + '/'+ method,
                    type: "POST",
                    data: data,
                    timeout: 15000,
                    success:  function (data) {
                        resultCallBack(data);
                    },
                    error: function (requestObj, status, error) {
                        faultCallBack(error);
                    },
                    complete: function (requestObj, status) {

                    }

                });
            };


        return {
            get: get,
            post : post
        };


    }();

    return ajaxService;
});
